<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="panel panel-default">
    <link rel="stylesheet" href="../../css/proposalDetail.css" />
    <div class="panel-heading">
        <h3>查看提案</h3>
    </div>

    <div class="panel-body">
        <section class="proposalDiv">
            <div class="proposal_title">
                <span class="title_font">{{proposal.title}}</span><br>
                <span class="blue_font">作者:</span>{{proposal.author.name}}&nbsp;&nbsp;
                <span class="blue_font">修改日期:</span>
                {{proposal.updateTime | date:"yyyy-MM-dd  h:mm a"}}&nbsp;&nbsp;
                <span class="blue_font">点击次数：</span>{{proposal.clickCount}}
                <br>
                <span class="blue_font">提案状态:</span>{{enums.proposalState[proposal.proposalState]}}&nbsp;&nbsp;
                <span class="blue_font">提案类型:</span>{{enums.proposalType[proposal.proposalType]}}&nbsp;&nbsp;
                <span class="blue_font">主办部门:</span>
                {{proposal.hostDepartment ? proposal.hostDepartment.name : '暂未设置'}}
            </div>

            <div class="proposal_content" id="proposalContent">

            </div>
        </section>
        <!--附件-->
        <h2>附件</h2>
        <div class="well">
            <div ng-repeat="attachment in proposal.attachments">
                <a ng-href="http://localhost:8080/attachment/download/{{attachment.id}}">
                    <i class="fa fa-file fa-fw"></i> {{attachment.filename}}
                </a>
                <span class="pull-right">{{attachment.size}} KB</span>
            </div>
        </div>
        <div class="row">
            <div ng-repeat="secondMotion in secondMotionList | orderBy:'id':false">
                <div class="well">
                    {{secondMotion.author.name}}说：<br>
                    {{secondMotion.content}}
                    <div ng-show="secondMotion.author.id == delegate.id">
                        <a ng-click="updateMotion(secondMotion)">修改</a>
                        <a ng-click="deleteMotion(secondMotion)">删除</a>
                    </div>
                </div>
            </div>
            <button class="btn btn-primary" ng-show="showMoreMotion" ng-click="refreshMotionList()">
                显示更多…
            </button>
        </div>
    </div>
    <div class="panel-footer">
        <h2>发表附议</h2>
        <div style="padding-bottom: 30px">
            <textarea class="form-control"
                      ng-model="secondMotionContent"
                      ng-disabled="{{proposal.author.id == delegate.id ? 'true' : 'false'}}"
                      placeholder="请输入您的附议内容，超过3条附议的提案才能立项">

            </textarea>
            <button class="btn btn-primary pull-right"
                    ng-click="(proposal.author.id == delegate.id ? 'true' : 'false') && publishSecondMotion()">
                {{proposal.author.id == delegate.id ? '不能给自己的提案附议' : '发表附议'}}
            </button>
        </div>
    </div>
</div>
